<script>
import Icon from '@/components/Iconfont'
export default {
  name: 'contact',
  components: {
    Icon: Icon
  },
  data() {
    return {
      itemArr: [
        {
          type: 'github',
          tel: 'xianrenbuxain',
          url: 'https://gitee.com/xianrenbuxain/my-site',
          popImg: "",
        },
        {
          type: 'mail',
          tel: '2765645570@qq.com',
          url: 'mailto:2765645570@qq.com',
          popImg: "",
        },
        {
          type: 'qq',
          tel: '2765645570',
          url: 'tencent://message/?Menu=yes&uin=2765645570&Service=300&sigT=45a1e5847943b64c6ff3990f8a9e644d2b31356cb0b4ac6b24663a3c8dd0f8aa12a595b1714f9d45',
          popImg: require('@/assets/qq.jpg'),
        },
        {
          type: 'weixin',
          tel: 'ddd13127',
          url: '',
          popImg: require('@/assets/weixin.jpg'),
        },
      ]
    }
  },
}
</script>



<template>
  <div class="contact-container">
    <ul>
      <li v-for="item in itemArr" :key="item.type">
        <a :href="item.url" target="_blank">
          <Icon :type="item.type" />
          <span>{{ item.tel }}</span>
          <div v-if="item.popImg" class="pop">
            <img :src="item.popImg" alt="">
          </div>
        </a>

      </li>
    </ul>
  </div>
</template>



<style lang='less' scoped>
@import '../../../styles/mixin.less';
@import '../../../styles/var.less';

.contact-container {
  width: 100%;
  height: 100%;
  padding: 10px;
  color: @lightWords;

  li {
    height: 30px;
    line-height: 30px;
    margin-top: 5px;

    a {
      position: relative;

      &:hover {
        .pop {
          transform: scale(1);
        }
      }

      .iconfont {
        font-size: 23px;
        margin-right: 10px;
        vertical-align: middle;
      }

      .pop {
        position: absolute;
        top: -105px;
        left: 10px;
        width: 100px;
        height: 100px;
        background-color: @gray;
        transform-origin: center bottom;
        transform: scale(0);
        transition: all 0.3s;

        &::before {
          content: '';
          position: absolute;
          bottom: 0;
          left: 50%;
          width: 10px;
          height: 10px;
          background-color: @gray;
          transform: rotate(45deg) translate(30%, 50%);
        }

        img {
          .self-center();
          width: 90%;
          height: 90%;
        }
      }

    }
  }
}
</style>